﻿<%@ Page Language="C#" MasterPageFile="~/Master.Master" AutoEventWireup="true" CodeBehind="SubAcountManagement.aspx.cs"
    Inherits="HoaDon.SubAcountManagement" Title="Quản lý tài khoản con" %>

<asp:Content ID="cthoadon" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <asp:ScriptManager runat="server">
    </asp:ScriptManager>
    <br />
    <br />
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <asp:GridView ID="gdvAccount" runat="server" AutoGenerateColumns="False" AllowPaging="True"
                ShowFooter="True" OnPageIndexChanging="OnPaging" OnRowEditing="EditDM" OnRowUpdating="UpdateDM"
                OnRowCancelingEdit="CancelEditDM" OnSelectedIndexChanging="ViewSubAccount">
                <AlternatingRowStyle BackColor="GradientActiveCaption" />
                <PagerStyle BackColor="WhiteSmoke" ForeColor="Black" HorizontalAlign="Center" />
                <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                <HeaderStyle BackColor="DodgerBlue" Font-Bold="True" ForeColor="White" />
                <EditRowStyle BackColor="#009933" />
                <Columns>
                    <asp:TemplateField HeaderText="Tài khoản">
                        <ItemTemplate>
                            <asp:Label ID="UserID" runat="server" Text='<%# Eval("UserID")%>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Họ tên">
                        <ItemTemplate>
                            <asp:Label ID="UserName" runat="server" Text='<%# Eval("UserName")%>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Trạng thái">
                        <ItemTemplate>
                            <div style="text-align: center;">
                                <asp:CheckBox ID="Status" runat="server" Width="10px" Checked='<%# (Convert.ToBoolean(Convert.ToInt32(Eval("Status"))))%>'
                                    Enabled="false"></asp:CheckBox></div>
                        </ItemTemplate>
                        <EditItemTemplate>
                            <div style="text-align: center;">
                                <asp:CheckBox ID="ckStatus" runat="server" Width="10px" Checked='<%# (Convert.ToBoolean(Convert.ToInt32(Eval("Status"))))%>'
                                    Enabled="true"></asp:CheckBox>
                            </div>
                        </EditItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField>
                        <ItemTemplate>
                            <asp:Button ID="btnEdit" runat="server" CommandArgument='<%# Eval("UserID")%>' Text="Sửa"
                                CommandName="Edit"></asp:Button>
                            <asp:Button ID="btnDedele" runat="server" CommandArgument='<%# Eval("UserID")%>'
                                Text="Xóa" OnClick="DeleteDM"></asp:Button>
                            <asp:Button ID="btView" runat="server" CommandArgument='<%# Eval("UserID")%>' Text="Xem"
                                CommandName="Select"></asp:Button>
                        </ItemTemplate>
                        <EditItemTemplate>
                            <asp:Button ID="btUpdate" runat="server" CommandArgument='<%# Eval("UserID")%>' Text="Đồng ý"
                                CommandName="Update" />
                            <asp:Button ID="btHuy" runat="server" CommandArgument='<%# Eval("UserID")%>' Text="Hủy"
                                CommandName="Cancel" />
                        </EditItemTemplate>
                    </asp:TemplateField>
                </Columns>
            </asp:GridView>
            <asp:Label ID="lbError" runat="server" ForeColor="Red"></asp:Label>
        </ContentTemplate>
        <Triggers>
            <asp:AsyncPostBackTrigger ControlID="gdvAccount" />
        </Triggers>
    </asp:UpdatePanel>
</asp:Content>
